package easy;

public class Solution_1941 {
    public boolean areOccurrencesEqual(String s) {
        int[] array = new int[26];
        for (int i = 0; i < s.length(); i++) {
            array[s.charAt(i)-'a']++;
        }
        for (int i = 0, count = 0; i < array.length; i++) {
            if (array[i]>0) {
                if (count==0) {
                    count = array[i];
                } else if (array[i] != count) {
                    return false;
                }
            }
        }
        return true;
    }
}
